package com.station.client.dragNDrop;

import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.DragStartEvent;
import com.google.gwt.event.dom.client.DragStartHandler;
import com.google.gwt.user.client.ui.Image;

/**
 * Created by Jimmy87 on 27.12.13.
 */
public class GrassItem extends Image {
    public GrassItem() {
        getElement().setDraggable(Element.DRAGGABLE_TRUE);
        setUrl("imgs/grass.jpg");
        setWidth("50px");
        setHeight("50px");
        addDragStartHandler(new DragStartHandler() {
            @Override
            public void onDragStart(DragStartEvent event) {
                event.setData("type","grass");
            }
        });
    }
}
